package Ajedrez;

class Alfil extends Pieza{

    protected int iniX, iniY, finX, finY;

    public Alfil() {
    }

    public Alfil(int iniX, int iniY, int finX, int finY) {
        this.iniX = iniX;
        this.iniY = iniY;
        this.finX = finX;
        this.finY = finY;
        corrept = false;
        int i, s;
        i = this.iniX + 1;

        // this.figura[i][s]=="blanco"
        for (s = this.iniY + 1; s < 8; s++) {
            if ((i == this.finX) && (s == this.finY)) {
                corrept = true;
            }
            i++;
        }


        //****************
        i = this.iniX + 1;

        for (s = this.iniY - 1; s > -1; s--) {
            if ((i == this.finX) && (s == this.finY)) {
                corrept = true;
            }
            i++;
        }


        //*******************
        i = this.iniX - 1;

        for (s = this.iniY + 1; s < 8; s++) {
            if ((i == this.finX) && (s == this.finY)) {
                corrept = true;
            }
            i--;
        }


        //**************
        i = this.iniX - 1;

        for (s = this.iniY - 1; s > -1; s--) {
            if ((i == this.finX) && (s == this.finY)) {
                corrept = true;
            }
            i--;
        }


    }
}
